<?php
/**
 * 自定义sentry 日志格式
 *
 * @date    2019-08-07 08:54:00
 * @version $Id$
 */

namespace App\Commons\Libs;

use Monolog\Formatter\LineFormatter;

class CustomizeLogFormatter
{
    /**
     * 自定义日志实例
     *
     * @param  \Illuminate\Log\Logger  $logger
     * @return void
     */
    public function __invoke($logger)
    {
        foreach ($logger->getHandlers() as $handler) {
            $handler->setFormatter(new LineFormatter('[%datetime%] %channel%.%level_name%: %message%'));
        }
    }
}
